<?php

switch($this->entity->texttype) {

    case 0:
                
    $paragraphs = explode("\r\n\r\n", $this->entity->textcontent);
            
    foreach ($paragraphs as $key => $value) {

        print "\n<p";
        
        $classes = NULL;
        
        if ($this->entity->textclass) {
            $classes[] = $this->entity->textclass;
        }
        
        if (($this->entity->paragraphstyle == 1 OR $this->entity->paragraphstyle == 3) AND $key == 0) {
        $classes[] = "first";
        }
        
        if (($this->entity->paragraphstyle == 2 OR $this->entity->paragraphstyle == 3) AND $key == sizeof($paragraphs)-1) {
        $classes[] = "last";
        }
        
        if ($classes) {
        $class_string = implode(" ", $classes);
        print " class=\"$class_string\"";
        }
        
        print ">\n";						
        // $value = $GLOBALS['ent_1_parser']->parse($value);
        print nl2br ($value);
        print "\n</p>\n";
    }
    break;

    case 1:
    print "\n<ul";
    if ($this->entity->textclass) {
        print " class=\"$this->entity->textclass\"";
    }
    print ">\n";
    $listoptions = explode("\r\n", $this->entity->textcontent);
    foreach ($listoptions as $key => $value) {
        // $value = $GLOBALS['ent_1_parser']->parse($value);
        print "<li>" . $value . "</li>\n";
    }
    print "</ul>\n";
    break;

    case 2:
    // $thetext = $GLOBALS['ent_1_parser']->parse($this->entity->textcontent);
    print nl2br($this->entity->textcontent);
    break;
}

